﻿using System.Collections.Generic;
using System.Linq;
using XRM.Security.DataAccess.Helpers;
using XRM.Security.DataAccess.Models;
using XRM.Security.WebUI.Models;

namespace XRM.Security.WebUI.Helpers
{
    public static class AutocompleteHelper
    {
        public static IEnumerable<AutocompleteItem> ToAutocompleteItems( this IEnumerable<UserRegister> items )
        {
            return items.Select( item => new AutocompleteItem { Label = item.FullName(), Label2 = item.Post } ).OrderBy( s => s.Label );
        }
    }
}